/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.own.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 药材收获信息Entity
 * @author F
 * @version 2019-09-27
 */
@Table(name="own_medicine_receipt_information", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一ID", isPK=true),
		@Column(name="own_medicine_plant_information_id", attrName="ownMedicinePlantInformationId", label="种植信息ID", isQuery=false),
		@Column(name="medicine_batch_id", attrName="medicineBatchId", label="药材批次号"),
		@Column(name="variety_name", attrName="varietyName", label="药材名称", queryType=QueryType.LIKE),
		@Column(name="weight", attrName="weight", label="药材重量", comment="药材重量(g)"),
		@Column(name="area_code", attrName="areaCode", label="所属区域代码"),
		@Column(name="batch_id", attrName="batchId", label="种植批次号"),
		@Column(name="harvest_time", attrName="harvestTime", label="收获时间"),
		@Column(name="seed_source", attrName="seedSource", label="种子来源"),
		@Column(name="fertilizer", attrName="fertilizer", label="施肥情况"),
		@Column(name="pesticide", attrName="pesticide", label="喷药情况"),
		@Column(name="inspection_situation", attrName="inspectionSituation", label="检验情况"),
		@Column(name="bm_batch_code", attrName="bmBatchCode", label="药材批次码"),
		@Column(name="create_company", attrName="createCompany", label="所属企业标识", isUpdate=false, isQuery=false),
		@Column(name ="uuid", attrName ="uuid",label = "操作标识符"),
		@Column(name="txid", attrName ="txid",label = "返回的txid"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class OwnMedicineReceiptInformation extends DataEntity<OwnMedicineReceiptInformation> {
	
	private static final long serialVersionUID = 1L;
	private String ownMedicinePlantInformationId;		// 种植信息ID
	private String medicineBatchId;		// 药材批次号
	private String varietyName;		// 药材名称
	private Double weight;		// 药材重量(g)
	private String areaCode;		// 所属区域代码
	private String batchId;		// 种植批次号
	private Date harvestTime;		// 收获时间
	private String seedSource;		// 种子来源
	private String fertilizer;		// 施肥情况
	private String inspectionSituation; //检验情况
	private String pesticide;		// 喷药情况
	private String bmBatchCode;		// 药材批次码
	private String createCompany;		// 所属企业标识
	private String uuid;		//索引本次操作的上下文标识

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getTxid() {
		return txid;
	}

	public void setTxid(String txid) {
		this.txid = txid;
	}

	private String txid;

	//非数据库字段
	private List<OwnMedicineInspectionInformation> ownMedicineInspectionInformationList; //检验信息

	public List<OwnMedicineInspectionInformation> getOwnMedicineInspectionInformationList() {
		return ownMedicineInspectionInformationList;
	}

	public void setOwnMedicineInspectionInformationList(List<OwnMedicineInspectionInformation> ownMedicineInspectionInformationList) {
		this.ownMedicineInspectionInformationList = ownMedicineInspectionInformationList;
	}

	public OwnMedicineReceiptInformation() {
		this(null);
	}

	public OwnMedicineReceiptInformation(String id){
		super(id);
	}

	@NotBlank(message="种植信息ID不能为空")
	@Length(min=0, max=64, message="种植信息ID长度不能超过 64 个字符")
	public String getOwnMedicinePlantInformationId() {
		return ownMedicinePlantInformationId;
	}

	public void setOwnMedicinePlantInformationId(String ownMedicinePlantInformationId) {
		this.ownMedicinePlantInformationId = ownMedicinePlantInformationId;
	}
	
	@NotBlank(message="药材批次号不能为空")
	@Length(min=0, max=25, message="药材批次号长度不能超过 25 个字符")
	public String getMedicineBatchId() {
		return medicineBatchId;
	}

	public void setMedicineBatchId(String medicineBatchId) {
		this.medicineBatchId = medicineBatchId;
	}
	
	@NotBlank(message="药材名称不能为空")
	@Length(min=0, max=50, message="药材名称长度不能超过 50 个字符")
	public String getVarietyName() {
		return varietyName;
	}

	public void setVarietyName(String varietyName) {
		this.varietyName = varietyName;
	}

	@NotNull(message="药材重量不能为空")
	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	@NotBlank(message="所属区域代码不能为空")
	@Length(min=0, max=6, message="所属区域代码长度不能超过 6 个字符")
	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	
	@NotBlank(message="种植批次号不能为空")
	@Length(min=0, max=25, message="种植批次号长度不能超过 25 个字符")
	public String getBatchId() {
		return batchId;
	}

	public void setBatchId(String batchId) {
		this.batchId = batchId;
	}

	@NotNull(message="收获时间不能为空")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getHarvestTime() {
		return harvestTime;
	}

	public void setHarvestTime(Date harvestTime) {
		this.harvestTime = harvestTime;
	}

	@NotBlank(message="种子来源不能为空")
	@Length(min=0, max=10, message="种子来源长度不能超过 10 个字符")
	public String getSeedSource() {
		return seedSource;
	}

	public void setSeedSource(String seedSource) {
		this.seedSource = seedSource;
	}

	@NotBlank(message="施肥情况不能为空")
	@Length(min=0, max=10, message="施肥情况长度不能超过 10 个字符")
	public String getFertilizer() {
		return fertilizer;
	}

	public void setFertilizer(String fertilizer) {
		this.fertilizer = fertilizer;
	}

	@NotBlank(message="喷药情况不能为空")
	@Length(min=0, max=10, message="喷药情况长度不能超过 10 个字符")
	public String getPesticide() {
		return pesticide;
	}

	public void setPesticide(String pesticide) {
		this.pesticide = pesticide;
	}

	@Length(min=0, max=10, message="检验情况长度不能超过 10 个字符")
	public String getInspectionSituation() {
		return inspectionSituation;
	}

	public void setInspectionSituation(String inspectionSituation) {
		this.inspectionSituation = inspectionSituation;
	}

	@Length(min=0, max=50, message="药材批次码长度不能超过 50 个字符")
	public String getBmBatchCode() {
		return bmBatchCode;
	}

	public void setBmBatchCode(String bmBatchCode) {
		this.bmBatchCode = bmBatchCode;
	}
	
	@Length(min=0, max=64, message="所属企业标识长度不能超过 64 个字符")
	public String getCreateCompany() {
		return createCompany;
	}

	public void setCreateCompany(String createCompany) {
		this.createCompany = createCompany;
	}
	
}